﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace SLRT.usercontrols
{
    /// <summary>
    /// Interaction logic for DetectionButtonsControl.xaml
    /// </summary>
    public partial class DetectionButtonsControl : UserControl
    {
        private UserControl parentWebcam;
        private List<Button> buttons;
        public static readonly DependencyProperty ParentWebcamControlProperty = DependencyProperty.Register("ParentWebcamControl", typeof(UserControl), typeof(DetectionButtonsControl), new PropertyMetadata(new PropertyChangedCallback(OnParentWebcamChanged)));
        public UserControl ParentWebcam
        {
            get
            {
                return this.parentWebcam;
            }
            set
            {
                this.parentWebcam = value;
            }
        }
        private static void OnParentWebcamChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { }

        public DetectionButtonsControl()
        {
            double imageWidth = 10;
            double imageHeight = 10;
            double buttonWidth;
            double smallDelimiter = 6 / 100 * imageWidth;
            double largeDelimiter = 8 / 100 * imageWidth;
            InitializeComponent();
            Button startButton = new Button();
            Button nextButton = new Button();
            Button backButton = new Button();
            Button stopButton = new Button();
            this.ButtonsStackPanel.Children.Add(startButton);
            this.ButtonsStackPanel.Children.Add(nextButton);
            this.ButtonsStackPanel.Children.Add(backButton);
            this.ButtonsStackPanel.Children.Add(stopButton);


            
            List<Button> buttons = new List<Button>();
            buttonWidth = (imageWidth - 2 * smallDelimiter - (buttons.Count - 1) * largeDelimiter) / buttons.Count;
            foreach (Button b in buttons)
            {
                
                if (buttons.IndexOf(b) == 1)
                {
                    //b.xPos = imageWidth + smallDelimiter;
                }
                else
                {
                    //b.xPos = imageWidth + largeDelimiter;
                }
            }
        }
    }
}
